import axios from 'axios'
import request from "@/utils/request.js";


//单独处理登录
export const loginAPI = async (account, password)=> {
	return axios({
		url: import.meta.env.VITE_BASE_API + '/zuihou/anno/token',
		method: 'POST',
		headers: {
			Authorization: import.meta.env.VITE_LOGIN_HEADER_AUTHORIZATION,
			tenant: import.meta.env.VITE_TENANT,
		},
		data: {
			tenantView: import.meta.env.VITE_TENANT_VIEW,
			tenant: import.meta.env.VITE_TENANT,
			grantType: import.meta.env.VITE_GRANT_TYPE,
			account,
			password
		}
	})
}

//完善用户信息
export const editUserInfoAPI = (data)=> {
	return request('/zuihou/user/base', 'put',  data)
}

//获取个人信息
export const getUserInfoAPI = (id)=> {
	return request(`/zuihou/user/${id}`, 'get')
}